package Classwork;

public class Test02 {
    public static void main(String[] args) {
        int[] arr1=new int[50];
        int[] arr2=new int[50];
        int[] arr3=new int[50];
        int x1=0;
        int x2=0;
        int x3=0;
        for (int i=1;i<=100;i++){
            if(i%3==0&&i%5!=0){
                arr1[x1]=i;
                x1++;
            }
            else if (i%5==0&&i%3!=0){
                arr2[x2]=i;
                x2++;
            }
            else if(i%5==0&&i%3==0){
                arr3[x3]=i;
                x3++;
            }
        }
        System.out.println("Flip:");
        for (int i=0;i<x1;i++){
            System.out.print(arr1[i]+" ");
        }
        System.out.println();
        System.out.println("Flop:");
        for (int i=0;i<x2;i++){
            System.out.print(arr2[i]+" ");
        }
        System.out.println();
        System.out.println("即Flip又Flop:");
        for (int i=0;i<x3;i++){
            System.out.print(arr3[i]+" ");
        }
    }

}
